home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 49
/
Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso
/
-serious-
/
graphics
/
amicad
/
arexx_english
/
selectparts.amicad
< prev
next >
Wrap
Text File
|
1999-12-06
|
2KB
|
64 lines
/* This script selects all the components with the same name
$VER: SelectParts.AmiCAD 1.03e (© R.Florac, 22 mai 1999) */
options results
signal on error /* error handling */
signal on syntax
'FIRSTSEL'; objet = result
if objet = 0 then do
'COMPOSANT=ASKTEXT("What''s the name of"+CHR(10)+"the searched component ?"+CHR(10)+"Wild chars can be used"+CHR(10)+"Ex: Diod#?","")'
part=result
if part="" then exit
end
else do
'COMPOSANT=PARTNAME('objet')'
part=result
if part="" then do
'TYPE('objet')'; type=result
'SECURITY(OBJECTS(-1)+10):FOR(I=1:N=0,I<=OBJECTS(-1),IF(TYPE(I)=='type',MARK(I):N=N+1,0),I=I+1)'
'N'; n=result
affichage(n,type)
exit
end
end
'SECURITY(OBJECTS(-1)+10):N=0:I=0:WHILE(I=IF(I+1<=OBJECTS(-1),FINDPART(I+1,COMPOSANT),0),MARK(I):N=N+1)'
'N'; n=result
affichage(n,1)
exit
affichage: procedure expose part
parse arg nombre, type
select
when type = 1 then element = part
when type = 2 then element = "wire"
when type = 3 then element = "arc"
when type = 4 then element = "text"
when type = 5 then element = "component reference"
when type = 6 then element = "component value"
when type = 7 then element = "junction"
when type = 8 then element = "dashed line"
when type = 9 then element = "bus"
when type = 10 then element = "ellipse"
when type = 11 then element = "input connector"
when type = 12 then element = "output connector"
when type = 15 then element = "double line"
when type = 21 then element = "other line"
when type = 22 then element = "box"
otherwise element = "object"
end
'MESSAGE("Selected object type:"+CHR(10)+"'element'"+CHR(10)+"Found: 'nombre'")'
exit
end
syntax:
erreur=RC
'MESSAGE("Script SelectParts"+CHR(10)+"Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
exit
error:
'MESSAGE("Script SelectParts"+CHR(10)+"Error in line 'SIGL'")'
exit